<script type='text/javascript'>
var thumbnail_mode = &quot;no-float&quot; ; 
var classicMnde = false ;
var summary_noimg = 24;
var summary_img = 25;
var indent = 3;

function stripHtmlTags(s,max){return s.replace(/&lt;.*?&gt;/ig, &#39;&#39;).split(/\s+/).slice(0,max-1).join(&#39; &#39;)}

function getSummaryLikeWP(id) {
        return document.getElementById(id).innerHTML.split(/&lt;!--\s*more\s*--&gt;/)[0];
}

function getSummaryImproved(post,max){
   var re = /&lt;.*?&gt;/gi
   var re2 = /&lt;br.*?&gt;/gi
   var re3 = /(&lt;\/{1}p&gt;)|(&lt;\/{1}div&gt;)/gi
   var re4 = /(&lt;style.*?\/{1}style&gt;)|(&lt;script.*?\/{1}script&gt;)|(&lt;table.*?\/{1}table&gt;)|(&lt;form.*?\/{1}form&gt;)|(&lt;code.*?\/{1}code&gt;)|(&lt;pre.*?\/{1}pre&gt;)/gi
   
   post = post.replace(re4,&#39;&#39;)
   post = post.replace(re3,&#39;&lt;br /&gt; &#39;).split(re2)
   
   for(var i=0; i&lt;post.length; i++){
    post[i] = post[i].replace(re,&#39;&#39;);
   }
 var post2 = new Array();
 for(var i in post) {
  //if(post[i]!=&#39;&#39; &amp;&amp; post[i]!=&#39; &#39; &amp;&amp; post[i] != &#39;\n&#39;) post2.push(post[i]);
  if(/[a-zA-Z0-9]/.test(post[i])) post2.push(post[i]) ;

 }
 
 
 var s = &quot;&quot;;
 var indentBlank = &quot;&quot;;
 for(var i=0;i&lt;indent;i++){
  indentBlank += &quot; &quot;;
 }
 if(post2.join(&#39;&lt;br/&gt;&#39;).split(&#39; &#39;).length &lt; max-1 ){
   s = post2.join(indentBlank +&#39; &lt;br/&gt;&#39;);
 } else {
  var i = 0;
  while(s.split(&#39; &#39;).length &lt; max){
   s += indentBlank + &#39; &#39; + post2[i]+&#39;&lt;br/&gt;&#39;;
   i++;
  }
 }  
 return s;
}


function createSummaryAndThumb(pID,title,url,date,comment){
 var posturl= url;
 var title=title;
 var date =date;
 var comment = comment;
 var div = document.getElementById(pID);
 var content = div.innerHTML;
 
  if (/&lt;!--\s*more\s*--&gt;/.test(content)) {
  div.innerHTML = getSummaryLikeWP(pID);
  div.style.display = &quot;block&quot;;
 } 
 else {
 
 var imgtag = &quot;&quot;;
 var img = div.getElementsByTagName(&quot;img&quot;);
 var summ = summary_noimg;
 if(img.length&gt;=1) { 
  
   imgtag = &#39;&lt;div class=&quot;feature-image&quot;&gt;&lt;a title=&quot;&#39;+title+&#39;&quot; href=&quot;&#39;+posturl+&#39;&quot;&gt; &lt;img width=&quot;300&quot; height=&quot;197&quot; class=&quot;thumbnail&quot; src=&quot;&#39;+img[0].src+&#39;&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&#39;;
   summ = summary_img;
  
 }
 var postlink= &#39;&lt;h2 class=&quot;post-title&quot;&gt;&lt;a title=&quot;&#39;+title+&#39;&quot; href=&quot;&#39;+posturl+&#39;&quot;&gt;&#39;+title+&#39;&lt;/a&gt;&lt;/h2&gt;&lt;div class=&quot;meta&quot;&gt;&#39;+date+&#39; | Comments (&#39;+comment+&#39;)&lt;/div&gt;&#39;;
 var summary = &#39;&lt;div class=&quot;post column clearfix&quot;&gt;&#39;+imgtag+&#39;&lt;div class=&quot;entry long&quot;&gt;&#39;+postlink+&#39;&lt;p&gt;&#39;+ stripHtmlTags(content,summ) + &#39;...&lt;/p&gt;&lt;/div&gt;&lt;p&gt;&lt;a href=&quot;&#39;+posturl+&#39;&quot; class=&quot;more-link&quot;&gt;Read more &lt;/a&gt;&lt;/p&gt;&lt;/div&gt;&#39;;
 
 div.innerHTML = summary;
 div.style.display = &quot;block&quot;;
 }
}

function createSummaryAndThumb1(pID,title,url,date,comment){
 var posturl= url;
 var title=title;
 var date =date;
 var comment = comment;
 var div = document.getElementById(pID);
 var content = div.innerHTML;
 
  if (/&lt;!--\s*more\s*--&gt;/.test(content)) {
  div.innerHTML = getSummaryLikeWP(pID);
  div.style.display = &quot;block&quot;;
 } 
 else {
 
 var imgtag = &quot;&quot;;
 var img = div.getElementsByTagName(&quot;img&quot;);
 var summ = summary_noimg;
 if(img.length&gt;=1) { 
  
   imgtag = &#39;&lt;div class=&quot;feature-image right&quot;&gt;&lt;a title=&quot;&#39;+title+&#39;&quot; href=&quot;&#39;+posturl+&#39;&quot;&gt; &lt;img width=&quot;150&quot; height=&quot;150&quot; class=&quot;thumbnail&quot; src=&quot;&#39;+img[0].src+&#39;&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&#39;;
   summ = summary_img;
  
 }
 var postlink= &#39;&lt;h2 class=&quot;post-title&quot;&gt;&lt;a title=&quot;&#39;+title+&#39;&quot; href=&quot;&#39;+posturl+&#39;&quot;&gt;&#39;+title+&#39;&lt;/a&gt;&lt;/h2&gt;&lt;div class=&quot;meta&quot;&gt;&#39;+date+&#39; | Comments (&#39;+comment+&#39;)&lt;/div&gt;&#39;;
 var summary = &#39;&lt;div style=&quot;width:616px;&quot; class=&quot;post clearfix&quot;&gt;&#39;+imgtag+&#39;&lt;div class=&quot;entry basic&quot;&gt;&#39;+postlink+&#39;&lt;p&gt;&#39;+ stripHtmlTags(content,summ) + &#39;...&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;&#39;+posturl+&#39;&quot; class=&quot;more-link&quot;&gt;Read more &lt;/a&gt;&lt;/p&gt;&lt;div style=&quot;clear: both;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&#39;;
 
 div.innerHTML = summary;
 div.style.display = &quot;block&quot;;
 }
}

</script>
